/**
 * Class: ParticleSource
 *
 * Purpose: 
 *
 * Created: Jan 23, 2010 @ 11:56:37 PM
 * @author Ken Scott
 */
package org.openfantasia.ps.fireworks;

import org.openfantasia.ps.particle.DefaultParticleFactory;
import org.openfantasia.ps.particle.Particle;
import org.openfantasia.ps.actor.Actor;
import org.openfantasia.ui.PFrame;
import org.openfantasia.util.math.PMath;

public class SparkFactory extends DefaultParticleFactory {

	protected double lifespan = 1.0;


	public SparkFactory(PFrame frame, double lifespan, Actor renderer) {
		super(frame, renderer);

		this.lifespan = lifespan;
	}


	public Particle createParticle() {
		Particle result = new Spark(lifespan * PMath.random(.8, 1.25));
		return result;
	}
}